package com.vincent.template.domain;

import com.vincent.template.commons.base.BaseIdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 绑定 用户组-角色
 * @Author Vincent Wang
 * @Date 2020/10/21 14:41
 */
@Entity
@Table(name = "sys_bind_user_group_role",
        indexes = {@Index(name = "idx_roleId", columnList = "roleId")},
        uniqueConstraints = {@UniqueConstraint(name = "UK_userGroupId_roleId", columnNames = {"userGroupId","roleId"})})
public class SysBindUserGroupRolePo extends BaseIdEntity {

    /**
     * 用户组ID
     */
    @Column(nullable = false)
    private Long userGroupId;
    /**
     * 角色ID
     */
    @Column(nullable = false)
    private Long roleId;

    public Long getUserGroupId() {
        return userGroupId;
    }

    public void setUserGroupId(Long userGroupId) {
        this.userGroupId = userGroupId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public SysBindUserGroupRolePo() {
    }

    public SysBindUserGroupRolePo(Long userGroupId, Long roleId) {
        this.userGroupId = userGroupId;
        this.roleId = roleId;
    }
}
